package io.gitee.baicaixiaozhan.configure;

import io.gitee.baicaixiaozhan.httpmessagewrapper.SimpleResult;
import io.gitee.baicaixiaozhan.httpmessagewrapper.UnifiedResult;
import io.gitee.baicaixiaozhan.httpmessagewrapper.UnifiedResultConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * DESC:
 *
 * @author baicaixiaozhan
 * @since v1.0.0
 */
@ConditionalOnBean(value = UnifiedResultConfiguration.class)
@Configuration
public class UnifiedResultAutoConfiguration {

    @Bean("unifiedResult")
    @ConditionalOnMissingBean(name = "unifiedResult")
    public UnifiedResult<Object> unifiedResult() {
        return new SimpleResult();
    }

}
